package com.example.pets_java.service;

import com.example.pets_java.mapper.PetChatMapper;
import com.example.pets_java.pojo.PetChat;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PetChatService {

    @Autowired
    private PetChatMapper petChatMapper;

    public List<PetChat> getChatsByPetId(int petId) {
        return petChatMapper.findByPetId(petId);
    }

    public void addChat(PetChat petChat) {
        petChatMapper.insert(petChat);
    }
}
